<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link href="css/redmond/jquery-ui-1.10.3.custom.min.css" rel="stylesheet" type="text/css">	<!-- jquery UI CSS函式庫 -->
<link href="css/selfTemplate.css" rel="stylesheet" type="text/css">							<!-- 自建CSS函式庫 -->
					
<script src="js/jquery-1.10.2.min.js" type="text/javascript"></script>								<!-- jquery 函式庫 -->
<script src="js/jquery-ui-1.10.3.custom.js" type="text/javascript"></script>					<!-- jquery UI 函式庫 -->
<script src="js/jquery.cookie.js" type="text/javascript"></script>								<!-- 操做cookie用 -->
<script src="js/widgets.js" type="text/javascript"></script>									<!-- 自建函式庫 -->


<script type="text/javascript">

$(document).ready(function(){
	
	init("index.html");
	;
	$("td#user").html("");
	$("#btnBackToMain").prop("disabled",true).html("");
	$(".banner").unbind("click");
	$("#logout").unbind("click");
	
	
	
	$("button").button();
	
	
	$("#btnLogin").bind("click", function(){
		
		clearErrorMsg();
		clearALLcookie();
		$.ajax({ type:'post',url:"Authentication",dataType:'text',async:false,
			data: {empId:$("#empId").val(),empPwd:$("#empPwd").val() },
				success : function(res) {
				if ( res != "NoNoNo" ) {
					if( res.length < 50) {
						$.cookie("empId", $("#empId").val() );
						$.cookie("empName", res );	
						window.location = "devMenu.html";
					} else {
						$("#errShortMsg").html("出現連線異常："+res);
					}
				} else {
					$("#errShortMsg").html("登入失敗，帳號與密碼無法配對");
				}
			}, error : function(xhr, ajaxOptions, thrownError) { 
				errorAjx(xhr);
			}
		});
	});
	
	
	//當使用者按下Enter鍵時，即等同按下呼叫鍵
	$("input").keypress(function(e) {
    	if (e.keyCode == $.ui.keyCode.ENTER) {
        	$("#btnLogin").click();
    	}
    }).val("");
	
	
});

</script>
</head>
<body>
	<div id="header"></div>		<!-- 畫面抬頭 -->

	<table>
		<thead class="tableFirst">
			<tr><th class='center' colspan="2">歡迎光臨</th></tr>
			<tr><th class='right'>帳號：</th><td class='left'><input class="engN" id="empId" type="text" maxlength="14" size="14" /></td></tr>
			<tr><th class='right'>密碼：</th><td class='left'><input class="engN" id="empPwd" type="password" maxlength="14" size="14" /></td></tr>
			<tr><td colspan="2">&nbsp;</td></tr>
			<tr><td class='center' colspan="2"><button id="btnLogin" type="button">登入</button>&nbsp;<button id="btnClear" type="button">清除</button></td></tr>
		</thead>
	</table>
</body>



</html>